<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <title>病人管理</title>
    <div th:insert="user/common::head"></div>
</head>

<body class="">
    <div class="wrapper ">
        <div th:insert="~{user/common::sidebar(active='patient_list.html')}"></div>
        <div class="main-panel">
            <!-- Navbar导航栏 -->
            <nav th:replace="~{user/common::navbar}"></nav>
            <!--搜索栏-->
            <div class="panel-header">
                <form id="search_form" th:action="@{/patient/search}">
                    <div class="header text-center">
                        <h2 class="title">病人管理</h2>
                        <div class="input-group no-border col-sm-4 offset-4">
                            <input type="text" name="search" class="form-control" th:placeholder="${msg==null?'姓名或联系方式...':msg}">
                            <span class="input-group-addon">
                            <i class="now-ui-icons ui-1_zoom-bold" onclick="$('#search_form').submit()"></i>
                        </span>
                        </div>
                        <p class="category">搜索住院患者记录,支持姓名模糊查询,联系方式精确查询。</p>
                    </div>
                </form>
            </div>
            <div class="content">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-header">
                                <h4 class="card-title">病人管理</h4>
                            </div>
                            <div class="card-body">
                                <div class="table-responsive">
                                    <table class="table">
                                        <thead class="text-primary">
                                            <th>
                                                病人姓名
                                            </th>
                                            <th>
                                                病人性别
                                            </th>
                                            <th>
                                                病人年龄
                                            </th>
                                            <th>
                                                联系方式
                                            </th>
                                            <th>
                                                所在病房
                                            </th>
                                            <th>
                                                住院日期
                                            </th>
                                            <th>
                                                出院日期
                                            </th>
                                            <th>
                                                详情
                                            </th>
                                        </thead>
                                        <tbody>
                                            <tr th:each="patient,index:${patients}">
                                                <td th:text="${patient.getPatientName()}">
                                                    Dakota Rice
                                                </td>
                                                <td th:text="${patient.getPatientGender()==1?'男':'女'}">
                                                    Niger
                                                </td>
                                                <td th:text="${patient.getPatientAge()}">
                                                    Oud-Turnhout
                                                </td>
                                                <td th:text="${patient.getPatientPhone()}">
                                                    15038609250
                                                </td>
                                                <td>
                                                    <a th:href="@{/queryBedInfoByInpatientWardId/}+${patient.getInpatientwardId()}" th:text="${patient.getInpatientwardId()}"></a>
                                                </td>
                                                <td th:text="${#dates.format(patient.getInDate(),'yyyy-MM-dd')}">
                                                    2021-01-29
                                                </td>
                                                <td th:text="${#dates.format(patient.getOutDate(),'yyyy-MM-dd')}">
                                                    2021-05-29
                                                </td>

                                                <td>
                                                    <a class="btn btn-primary text-white" th:href="@{/patient/info/}+${patient.getPatientId()}">查看详情</a>
                                                </td>


                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--底部footer-->
            <footer th:replace="~{user/common::footer}"></footer>
        </div>
    </div>
</body>

<!--通用footerJs-->
<script th:replace="~{user/common::footerJs}"></script>

</html>
